<template>
  <h3>职业:{{ job.type }}</h3>
  <h3>薪水:{{ job.salary }}</h3>
  <button @click="changeType">更新职业</button>
  <button @click="salary++">更新薪水</button>
  <hr>
  <h3>{{count}}</h3>
  <button @click="count++">更新薪水</button>
  <!-- <button @click="changeCount">更新薪水</button> -->
</template>

<script>
import { reactive, toRef , ref, toRefs} from 'vue'
export default {
    setup () {
        // let count = 0
        // function changeCount() {
        //     count ++
        //     console.log(count)
        // }
        const count = ref(0)
        const job = ref({
            salary: 100,
            type: '送快递的'
        })
        function changeType () {
            console.log(job.value)
            job.value.salary = '前端'
        }
        // console.log(count)
        return {
            changeType,
            job,
            count
        }
    }
};
</script>

<style>
</style>